cmake_minimum_required(VERSION 2.8)

add_definitions("-g")
add_definitions("-W")
add_definitions("-O3")
add_definitions("-Wall")
add_definitions("-Werror")
add_definitions("-Wshadow")
add_definitions("-Wpointer-arith")
add_definitions("-Waggregate-return")
add_definitions("-Wmissing-prototypes")
add_definitions("-D_REENTRANT")
add_definitions("-D_USE_FAST_MACRO")
add_definitions("-DACL_WRITEABLE_CHECK")
add_definitions("-Wno-long-long")
add_definitions("-Wuninitialized")
add_definitions("-D_POSIX_PTHREAD_SEMANTICS")
add_definitions("-DACL_PREPARE_COMPILE")

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
	add_definitions("-DLINUX2")
	add_definitions("-Wstrict-prototypes")
	add_definitions("-fPIC")
endif()

message(${PROJECT_SOURCE_DIR})
set(rpath lib_acl)
set(src ${PROJECT_SOURCE_DIR}/${rpath}/src)

message(${src})
message(${src}/stdlib)
include_directories(${PROJECT_SOURCE_DIR}/${rpath})
include_directories(${PROJECT_SOURCE_DIR}/${rpath}/include)
aux_source_directory(${src}/stdlib lib_src)
aux_source_directory(${src}/stdlib/debug lib_src)
aux_source_directory(${src}/stdlib/memory lib_src)
aux_source_directory(${src}/stdlib/filedir lib_src)
aux_source_directory(${src}/stdlib/string lib_src)
aux_source_directory(${src}/stdlib/common lib_src)
aux_source_directory(${src}/stdlib/sys lib_src)
aux_source_directory(${src}/stdlib/sys/unix lib_src)
aux_source_directory(${src}/stdlib/configure lib_src)
aux_source_directory(${src}/stdlib/iostuff lib_src)
aux_source_directory(${src}/aio lib_src)
aux_source_directory(${src}/code lib_src)
aux_source_directory(${src}/db lib_src)
aux_source_directory(${src}/db/memdb lib_src)
aux_source_directory(${src}/db/mysql lib_src)
aux_source_directory(${src}/db/null lib_src)
aux_source_directory(${src}/db/zdb lib_src)
aux_source_directory(${src}/event lib_src)
aux_source_directory(${src}/init lib_src)
aux_source_directory(${src}/ioctl lib_src)
aux_source_directory(${src}/json lib_src)
aux_source_directory(${src}/master lib_src)
aux_source_directory(${src}/master/framework lib_src)
aux_source_directory(${src}/master/framework/trigger lib_src)
aux_source_directory(${src}/master/template lib_src)
aux_source_directory(${src}/msg lib_src)
aux_source_directory(${src}/net lib_src)
aux_source_directory(${src}/net/dns lib_src)
aux_source_directory(${src}/net/connect lib_src)
aux_source_directory(${src}/net/listen lib_src)
aux_source_directory(${src}/private lib_src)
aux_source_directory(${src}/thread lib_src)
aux_source_directory(${src}/unit_test lib_src)
aux_source_directory(${src}/xml lib_src)

add_library(_acl ${lib_src})
#add_library(_acl SHARED ${lib_src})
